<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="../../assets/js/vue.js"></script>
    <title>Model</title>
</head>
<body>
<div id="app">
    <p>原始信息：({{ message }})</p>
    <p><input type="text" v-model="message">->v-model</p>
    1.修饰符：lazy(延迟加载，失去焦点时改变值) number trim
    <p><input type="text" v-model.lazy="message">->v-model.lazy</p>
    <p><input type="text" v-model.number="message">->v-model.number</p>
    <p><input type="text" v-model.trim="message">->v-model.trim</p>
    2.文本框
    <p><textarea cols="30" rows="3" v-model="message"></textarea></p>
    3.多选按钮绑定一个值
    <p>
        <input type="checkbox" id="id" v-model="isTrue">
        <label for="id">点击文字选中/取消</label>
    </p>
    <p>{{ isTrue }}</p>
    4.多选绑定一个数组
    <p>
        <input type="checkbox" id="id1" value="Jack" v-model="names">
        <label for="id1">Jack</label>
        <input type="checkbox" id="id2" value="Marray" v-model="names">
        <label for="id2">Marray</label>
        <input type="checkbox" id="id3" value="David" v-model="names">
        <label for="id3">David</label>
    </p>
    <p>{{ names }}</p>
    5.单选按钮绑定数据
    <p>
        <label><input type="radio" value="男" v-model="sex">男</label>
        <label><input type="radio" value="女" v-model="sex">女</label>
    </p>
    <p>{{ sex }}</p>
</div>

<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            message: "show message",
            isTrue: "",
            names: [],
            sex: ""
        }
    })
</script>
</body>
</html>